import service, {
  config
} from '@/utils/request'

// 新增安全绩效
export function addSafeAssessment(params) {
  return service.post('/safe-performance/add', params)
}

// 查询安全绩效
export function searchSafeAssessment(params) {
  return service.post('/safe-performance/list', params)
}

// 删除安全绩效
export function delSafeAssessment(id) {
  return service.delete(`/safe-performance/delete?id=${id}`)
}

// 删除安全绩效要点
export function delSafeAssessmentItem(params) {
  // return service.delete(`/safe-performance/delete_point`,params)
  return service({
    method: 'delete',
    url: '/safe-performance/delete_point',
    data: params
  })
}

// 更改子绩效
export function editItem(params) {
  return service.post('/safe-performance/addOrUpdateChildren', params)
}

//批量新增子接口
export function addSafeAssessmentItem(params) {
  return service.post('/safe-performance/add_point', params)
}

// 修改父级
export function updateParent(params) {
  return service.post('/safe-performance/update', params)
}




//获取父级列表
export function getParentList(params) {
  return service.post('/safe-performance-parent/list', params)
}
//新增/编辑父级类别
export function addParentList(params) {
  return service.post('/safe-performance-parent/add', params)
}
//删除父级
export function removeParentList(id){
  return service.get(`/safe-performance-parent/del?id=${id}`)
}
//父级点击查看详情
export function lookParentItem(id){
  return service.get(`/safe-performance-parent/detail?id=${id}`)
}